/**
 * Created by zhulizhe on 2018/8/19.
 */

import {requestBanner} from "../services/api";

export default {

  namespace: 'orderwater',

  state: {
    banner:[]
  },

  subscriptions: {
    setup({ dispatch, history }) {  // eslint-disable-line
    },
  },

  effects: {
    *banner({ payload }, { call, put }) {  // eslint-disable-line
      const response = yield call(requestBanner,payload) ;

      console.log('payload',payload);
      console.log('response',response);
      yield put({ type: 'save' });
    },
  },

  reducers: {
    save(state, action) {
      return { ...state, ...action.payload };
    },
  },

};
